package 面向对象.student;

public class StudentTest {
    public static void main(String[] args) {

        // 创建学生对象

        Student s1 = new Student();

        // 给成员变量赋值
        s1.setName("张三");
        s1.setAge(18);
        s1.setGender("男");

        // 获取成员变量的值
        System.out.println(s1.getName());
        System.out.println(s1.getAge());
        System.out.println(s1.getGender());

        // 调用成员方法
        s1.study();
        s1.sleep();

        // 创建新的学生对象
        Student s2 = new Student();
        System.out.println("--------");
        s2.setName("李四");
        s2.setAge(20);
        s2.setGender("女");
        System.out.println(s2.getName());
        System.out.println(s2.getAge());
        System.out.println(s2.getGender());
        s2.study();
        s2.sleep();

    }
}
